<?php

namespace Home\Model;

use Think\Model;

class GoodsBrandModel extends Model
{
    public function __construct()
    {
        parent::__construct('goods_brand');
    }

    /**
     * 取得商品品牌列表
     * @param unknown $condition
     * @param string $fields
     * @param string $order
     * @param string $limit
     * @param string $pagesize
     */
    public function brandList($condition = array(), $fields = '*', $order = 'sort_order asc', $limit = '', $pagesize = '', $num = '')
    {
        return $this->where($condition)->field($fields)->order($order)->limit($limit)->page($pagesize, $num)->select();
    }

    /**
     * 取得商品品牌单条信息
     * @param unknown $condition
     * @param string $fields
     */
    public function brandInfo($condition = array(), $fields = '*')
    {
        return $this->where($condition)->field($fields)->find();
    }

    /**
     * 取得商品品牌数量
     * @param unknown $condition
     */
    public function brandCount($condition)
    {
        return $this->where($condition)->count();
    }

}